//
//  ST_OnlineStatusBallControl.swift
//  btvideo
//
//  Created by Jason on 2021/12/20.
//  Copyright © 2021 JarvanZhang. All rights reserved.
//

import UIKit


class ST_OnlineStatusBallControl:UIControl{
    
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        self.cornerRadius = TIANCompatibleValue(value: 5)
        self.borderColor = UIColor.white
        self.borderWidth = 2
        self.alpha = 0
        
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    /**
     0 隐藏 ， 1 绿色 ,2 黄色
     */
    var status = 0{
        didSet{
            
            if status == 0 {
                self.alpha = 0
            }else{
                self.alpha = 1
                self.backgroundColor = status == 1 ? UIColor.init(hex: 0x54E78E) : UIColor.init(hex: 0xFEC207)
            }
        }
    }
    
}
